|
The affine cipher is a type of monoalphabetic substitution cipher, wherein each letter in an alphabet is mapped to its numeric equivalent, encrypted using a simple mathematical function, and converted back to a letter. The formula used means that each letter encrypts to one other letter, and back again, meaning the cipher is essentially a standard substitution cipher with a rule governing which letter goes to which. As such, it has the weaknesses of all substitution ciphers. Each letter is enciphered with the function , where is the magnitude of the shift. ==Description== In the affine cipher the letters of an alphabet of size are first mapped to the integers in the range . It then uses modular arithmetic to transform the integer that each plaintext letter corresponds to into another integer that correspond to a ciphertext letter. The encryption function for a single letter is : where modulus is the size of the alphabet and and are the key of the cipher. The value must be chosen such that and are coprime. The decryption function is : where is the modular multiplicative inverse of modulo . I.e., it satisfies the equation : The multiplicative inverse of only exists if and are coprime. Hence without the restriction on decryption might not be possible. It can be shown as follows that decryption function is the inverse of the encryption function, : 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Affine cipher」の詳細全文を読む スポンサード リンク
|